<template>
	<view :class="['vh100',{'dark':theme == 'dark'}]">
		
		
		<u-collapse>
				<u-collapse-item :title="item.title" v-for="(item, index) in list" :key="index">
					<u-parse :html="item.content">
					</u-parse>
				</u-collapse-item>
			</u-collapse>
	</view>
</template>

<script>
	import {mapState,mapActions,mapGetters} from 'vuex';
	import {
		commonProblem
	} from '../../common/apiString.js'
	import {myMixins} from '@/common/myMixins.js'//加入全局下拉刷新
	export default{
		mixins:[myMixins],
		data() {
			return {
				list:[],
				url:'https://www.baidu.com',
				content: `<p>露从今夜白，月是故乡明</p><img src="https://cdn.uviewui.com/uview/swiper/2.jpg" />`
			}
		},
		computed:{
			...mapState({
			  theme:state=>state.theme
			}),
		},
		onLoad() {
			uni.setNavigationBarTitle({
				title:this.$t('login').receipt
			})
			this.$utils.setTheme(this.theme);
			this.getHtml()
		},
		methods:{
			showItem(item){
				this.list.forEach((res)=>{
					if(res.problemId != item.problemId){
						res.showFlag=false
						
					}else{
						res.showFlag=true
						console.log('开启'+res.title)
					}
				})
			},
			getHtml(){
				this.$utils.initData({
					url: commonProblem,
					data: {
						type: 'HELP',
						size:100
					},
					type: 'post'
				}, (res, msg) => {
					//uni.stopPullDownRefresh();
					this.list=res.records
					this.list.forEach(res=>{
							res.showFlag=false
					})
				})
			}
		}
	}
</script>

<style lang="scss">
	.vh100 {
	    min-height: 100vh;
	    padding: 2vw;
	}
</style>
